package com.gitee.huanminabc.utils_tools.security.core;

import com.gitee.huanminabc.jcommon.encryption.JwtUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JwtConfig {
    @Value("${jwt.config.access-key}")
    private String accessKey;
    @Value("${jwt.config.refresh-key}")
    private String refreshKey;
    //过期时间(在配置文件中配置的)
    @Value("${jwt.config.access}")
    private long access;
    @Value("${jwt.config.refresh}")
    private long refresh;
    @Value("${jwt.config.custom}")
    private long custom;

    @Bean
    public JwtUtil jwtUtil() {
        return new JwtUtil(accessKey, refreshKey, access, refresh, custom);
    }
}
